package com.feidee.data.report.model.multidimensional_analysis;

public class MultiDimAnalysisRsp<T> {

  private boolean success;

  private String msg;

  private T data;

  public boolean isSuccess() {
    return success;
  }

  public void setSuccess(boolean success) {
    this.success = success;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public T getData() {
    return data;
  }

  public void setData(T data) {
    this.data = data;
  }

  public static class Builder {
    public static MultiDimAnalysisRsp buildSuccess(Object data) {
      MultiDimAnalysisRsp rsp = new MultiDimAnalysisRsp();
      rsp.setData(data);
      rsp.setSuccess(true);
      return rsp;
    }
    public static MultiDimAnalysisRsp buildAuthError(String reason) {
      MultiDimAnalysisRsp rsp = new MultiDimAnalysisRsp();
      rsp.setSuccess(false);
      rsp.setMsg("鉴权失败：" + reason);
      return rsp;
    }
    public static MultiDimAnalysisRsp buildGenericError(String reason) {
      MultiDimAnalysisRsp rsp = new MultiDimAnalysisRsp();
      rsp.setSuccess(false);
      rsp.setMsg("查询失败：" + reason);
      return rsp;
    }
  }

}
